import React from 'react'
import { useMatch, useParams } from 'react-router-dom'

export default function Detail() {
  const { id, title, content } = useParams()
  // 注意useMatch里面写完整路径，包括参数。这一拿到完整的路由属性
  const x = useMatch('/home/news/details/:id/:title/:content')
  console.log(x)
  return (
    <div>
      <ul>
        <li>{id}</li>
        <li>{title}</li>
        <li>{content}</li>
      </ul>
    </div>
  )
}
